package com.cw.jeeyt.dao.impl.process;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cw.jeeyt.common.Order;
import com.cw.jeeyt.dao.intf.process.ActDeModelRelationDao;
import com.cw.jeeyt.dao.mapper.process.ActDeModelRelationMapper;
import com.cw.jeeyt.dao.model.process.ActDeModelRelationDo;
import com.cw.lang.common.utils.PageUtil;
import com.cw.lang.common.pagehelper.PageHelper;
import com.cw.lang.mybatis.dto.PageInfo;

/**
 * 流程定义模型关联 dao数据库操作接口
 *
 * @author chenw
 * @date 2019-03-10 21:47:04
 */
@Repository
public class ActDeModelRelationDaoImpl implements ActDeModelRelationDao {
    @Autowired
    private ActDeModelRelationMapper actDeModelRelationMapper;

    /**
     * 新增流程定义模型关联
     *
     * @param actDeModelRelation
     * @return 整数
     */
    public Integer insert(ActDeModelRelationDo actDeModelRelation) {
        return actDeModelRelationMapper.insert(actDeModelRelation);
    }

    /**
     * 新增流程定义模型关联不为空的字段
     *
     * @param actDeModelRelation
     * @return 整数
     */
    public Integer insertSelective(ActDeModelRelationDo actDeModelRelation) {
        return actDeModelRelationMapper.insertSelective(actDeModelRelation);
    }

    /**
     * 删除流程定义模型关联
     *
     * @param actDeModelRelation
     */
    public void delete(ActDeModelRelationDo actDeModelRelation) {
        actDeModelRelationMapper.delete(actDeModelRelation);
    }

    /**
     * 修改流程定义模型关联不为null的字段
     *
     * @param actDeModelRelation
     */
    public void updateSelective(ActDeModelRelationDo actDeModelRelation) {
        actDeModelRelationMapper.updateSelective(actDeModelRelation);
    }

    /**
     * 修改流程定义模型关联
     *
     * @param actDeModelRelation
     */
    public void update(ActDeModelRelationDo actDeModelRelation) {
        actDeModelRelationMapper.update(actDeModelRelation);
    }

    /**
     * 根据主键查询流程定义模型关联
     *
     * @return 流程定义模型关联
     */
    public ActDeModelRelationDo getById(String id) {
        return actDeModelRelationMapper.getById(id);
    }

    /**
     * 查询所有流程定义模型关联
     *
     * @return 流程定义模型关联集合
     */
    public List<ActDeModelRelationDo> queryActDeModelRelationList() {
        return actDeModelRelationMapper.queryActDeModelRelationList();
    }

    /**
     * 分页查询流程定义模型关联
     *
     * @param actDeModelRelation 查询条件
     * @param startNum 开始条数
     * @param pageSize 每页长度
     * @return 流程定义模型关联集合
     */
    public PageInfo<ActDeModelRelationDo> queryByPage(ActDeModelRelationDo actDeModelRelation, Integer startNum,
        Integer pageSize, Order order) {
        PageHelper.startPage(PageUtil.calPageNum(startNum, pageSize), pageSize);
        return new PageInfo<>(actDeModelRelationMapper.queryByPage(actDeModelRelation, order));
    }
}
